/*****************************************************
Copyright (C) 2020. All rights reserved.
File name     ：BinaryHeap.h
Version       ：v1.0
Author        ：zhengqijun
Date          ：2020-04-04
Function List ：
Description   ：Binary Heap
******************************************************/

#ifndef BINARYHEAP_H_
#define BINARYHEAP_H_

// Type Definition
struct HeapStruct;
typedef int ElementType;
typedef struct HeapStruct *PriorityQueue;

// Function Lists
PriorityQueue Initialize(int MaxElements);
void Destroy(PriorityQueue H);
void MakeEmpty(PriorityQueue H);
void Insert(ElementType X, PriorityQueue H);
ElementType DeleteMin(PriorityQueue H);
ElementType FindMin(PriorityQueue H);
PriorityQueue BuildHeap(ElementType A[], int N);
void DecreaseKey(int P, ElementType X, PriorityQueue H);
void IncreaseKey(int P, ElementType X, PriorityQueue H);
void Delete(int P, PriorityQueue H);
int IsEmpty(PriorityQueue H);
int IsFull(PriorityQueue H);
int Size(PriorityQueue H);
ElementType Retrieve(PriorityQueue H, int Index);

#endif  /* BINARYHEAP_H_ */

// EOF

